package cn.cs.client;

import cn.cs.config.CsConfiguration;
import cn.cs.fallback.AfterOrderFallBack;
import cn.cs.fallback.InvoiceTitleFallBack;
import cn.cs.pojo.AfterOrder;
import cn.cs.pojo.InvoiceTitle;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Map;

@FeignClient(name = "cs-order-provider", configuration = CsConfiguration.class, fallback = InvoiceTitleFallBack.class)
public interface RestInvoiceTitleClient {


    @RequestMapping(value = "/getInvoiceTitleById", method = RequestMethod.POST)
    public InvoiceTitle getInvoiceTitleById(@RequestParam("id") Long id)throws Exception;

    @RequestMapping(value = "/getInvoiceTitleByName", method = RequestMethod.POST)
    public InvoiceTitle	getInvoiceTitleByName(@RequestParam("name") String name, @RequestParam("userId") String userId)throws Exception;

    @RequestMapping(value = "/getInvoiceTitleListByUserId", method = RequestMethod.POST)
    public List<InvoiceTitle> getInvoiceTitleListByUserId(@RequestParam("userId") String userId)throws Exception;

    @RequestMapping(value = "/addInvoiceTitle", method = RequestMethod.POST)
    public Integer addInvoiceTitle(@RequestBody InvoiceTitle invoiceTitle)throws Exception;

    @RequestMapping(value = "/modifyInvoiceTitle", method = RequestMethod.POST)
    public Integer modifyInvoiceTitle(@RequestBody InvoiceTitle invoiceTitle)throws Exception;

    @RequestMapping(value = "/deleteInvoiceTitleById", method = RequestMethod.POST)
    public Integer deleteInvoiceTitleById(@RequestParam("id") Long id)throws Exception;

    @RequestMapping(value = "/setDefault", method = RequestMethod.POST)
    public Integer setDefault(@RequestParam("id") Long id)throws Exception;

    @RequestMapping(value = "/setDefaultAll", method = RequestMethod.POST)
    public Integer setDefaultAll(@RequestParam("userId") String userId)throws Exception;

    @RequestMapping(value = "/getDefaultByUserId", method = RequestMethod.POST)
    public InvoiceTitle getDefaultByUserId(@RequestParam("userId") String userId)throws Exception;



}
